
-- Project: Intro to SQL
-- Description: 
	-- This is the introduction to SQL. 
	-- In this database we will create a table and put data in the table too. 
	-- We will also use different commands, such as create database, describe, insert into, values, and more. 
	-- This is a simple project to get started on SQL.
-- Jamila Kandawala
-- 10/18/2024


create database intro; -- This is making me create a database called intro, which allows me to put tables inside this database.

use intro; -- This will allow me to use this database called intro, so whatever commands I use after it will be inside this database. 

-- I am creating a table called pinfo in the database called intro. This will make a table and the things in side it will be the columns.
create table pinfo(
	id int primary key auto_increment, -- I am making the primary key auto_increment, which means that it has no value. 
	-- All of these columns have varchar because it is a type of field and it will be a string. 
	firstname varchar(20), -- I am making a column called firstname, which will have a maximum of 20 characters.
	lastname varchar(20), -- I am making a column called lastname, which will have a maximum of 20 characters.
	address varchar(50), -- I am making an address column, which will have a maximum of 50 characters. 
	city varchar(20), -- I am making a city column, which will have a maximum of 20 characters.
	theState varchar(2), -- I am making a state column, which will have a maximum of 2 characters. This will be the abbreviation for the states.
	zipCode varchar(5) -- I am making a zipCode column, which will have a maximum of 5 characters.
);

-- This will describe the table, which will be describing the columns and the data that it has, whcih is needed and it is very important. 
describe pinfo;

-- This will insert the columns listed in the parenthesis into the table, which will allow the data to be inputted later too. 
insert into pinfo 
(firstname, lastname, address, city, theState, zipCode) -- These are the names of the columns, which will be the order of the data below. 
values -- This is the values that will be in the columns, which is also known as the data. 
('Stephen', 'Angelella', '2788 Marion Street', 'Bellmore', 'NY', '11710'), -- This is the data , which will be in the same order above, which is about Stephen.
('Allen', 'Attaway', 'PO Box 643', 'Piscataway', 'NJ', '08855'), -- This is the data , which will be in the same order above, which is about Allen.
('Baron', 'Ballester', '186 Lexington Avenue', 'Westwood', 'NJ', '07675'), -- This is the data , which will be in the same order above, which is about Baron.
('George', 'Bartels', '77 Allen Road', 'Rockville Centre', 'NY', '11570'), -- This is the data , which will be in the same order above, which is about George.
('Michael', 'Bartolome', '228 South 17th Avenue', 'Manville', 'NJ', '08835'), -- This is the data , which will be in the same order above, which is about Michael.
('Hugh', 'Bentley', '7 Holly Treee Lane', 'East Islip', 'NY', '11730'), -- This is the data , which will be in the same order above, which is about Hugh.
('Robert', 'Bielsky', '931 Peninsula Blvd', 'Woodmere', 'NY', '11598'), -- This is the data , which will be in the same order above, which is about Robert.
('George', 'Botsch', '511 Rockaway Street', 'West Islip', 'NY', '11795'), -- This is the data , which will be in the same order above, which is about George.
('Duane', 'Burrell', '22 Van Buskirk Rd', 'Teaneck', 'NJ', '07666'), -- This is the data , which will be in the same order above, which is about Duane.
('Michael', 'Caldarella', '108 Kemah-Mecca Lake Road', 'Newton', 'NJ', '07860') -- This is the data , which will be in the same order above, which is about Michael.
; 

SELECT * FROM pinfo; -- This will select all the data in the table, pinfo, which will output it to be displayed.
drop database intro; -- This will delete the database, which is called intro, which will also delete the table in the database too. 
























